package method.method1202;

public class exe03 {
    public static void main(String[] args) {
        int[] arr={10,9,12,8,3};
        int[] crr=num(arr);
        System.out.println("最大值是："+crr[0]);
        System.out.println("最小值是："+crr[1]);
    }
    public static int[] num(int[] arr){
        int max=arr[0];
        int min=arr[0];
        for (int i = 1; i < arr.length; i++) {
            max=arr[i]>max?arr[i]:max;
            min=arr[i]>min?min:arr[i];
        }
         int[] brr={max,min};
        return brr;
    }
}
